<extend name="Public:base" />

<block name="content">

    <div class="row">
        <div class="col-xs-12">
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover" id="mytable">

                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>利率名称</th>
                        <th>利率</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="list" id="ba" key="k">
                        <tr>
                            <td>{$k}</td>
                            <td>{$ba['name']}</td>
                            <td>{$ba['rate']}</td>
                            <td>
                                <span>
                                <a  style="{$update==1?'':'display: none'}" class="btn btn-info radius5 btn-xs" href="{:U('InterestRate/update&id='.$ba['id'])}">编辑</a>
                                </span>
                                <!--  <span>
                                    <a class="btn btn-info radius5 btn-xs" onclick="dell({$ba['id']})">删除</a>
                                      </span>-->
                            </td>
                        </tr>
                    </volist>
                    <tr>
                        <td colspan="20" class="page">{$page}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</block>
<block name="css">
    <style type="text/css">
        .table.table-bordered thead tr th {
            vertical-align: middle;
            text-align: center;
        }
    </style>
</block>
<block name="javascript">
    <script>
        function del(id){
            $.ajax({
                url:"{:U('InterestRate/delete')}",
                type:"post",
                data:{
                    id:id,
                },
                success:function(){
                    $.jbox.info('修改成功','提示信息');
                    window.setTimeout(function () {window.location.href="{:U('InterestRate/index')}"; }, 500);
                }
            })
        }

        function dell(id){
            var submit = function (v, h, f) {
                if (v == 'ok')
                    del(id)
                else if (v == 'cancel')


                return true; //close
            };
            $.jbox.confirm("确定删除吗？", "提示", submit);
        }

    </script>
</block>